import { Controller, Get, Param, Post, Body } from '@nestjs/common';
import { Controller, Get, Param, Post, Body } from '@nestjs/common';
import { UserService } from './user.service';
@Controller('users')
export class UserController {
   constructor(private readonly userService: UserService) {}
  @Get()
  getUsers() {
    // 实际业务逻辑
    return userService.findAll();
  }

  @Get(':id')
  getUser(@Param('id') id: string) {
    // 实际业务逻辑
    return userService.findById(+id);
  }

  @Post()
  createUser(@Body() data: CreateUserDto) {
    // 实际业务逻辑
    return userService.create(data);
  }
}